package com.example.demo.pattern.mixpattern.factory;

import com.example.demo.pattern.mixpattern.entity.duck.QuackAble;
import com.example.demo.pattern.mixpattern.entity.duck.impl.DuckCall;
import com.example.demo.pattern.mixpattern.entity.duck.impl.MallardDuck;
import com.example.demo.pattern.mixpattern.entity.duck.impl.RedHeadDuck;
import com.example.demo.pattern.mixpattern.entity.duck.impl.RubberDuck;

//生产普通鸭子，new就完事了
public class DuckFactory extends AbstractDuckFactory{
    @Override
    public QuackAble createMallardDuck() {
        return new MallardDuck();
    }

    @Override
    public QuackAble createRedHeadDuck() {
        return new RedHeadDuck();
    }

    @Override
    public QuackAble createRubberDuck() {
        return new RubberDuck();
    }

    @Override
    public QuackAble createDuckCall() {
        return new DuckCall();
    }
}
